package com.bjtime.hprinter.Fragments.designer

import android.os.Bundle
import android.support.v4.app.Fragment
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.EditText
import android.widget.LinearLayout
import com.bjtime.hprinter.R


class Sets : Fragment  , View.OnClickListener{

    constructor()



    companion object {
        fun newInstance(): Sets {
            return Sets ()
        }
    }


    private var mView   : View? = null
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        mView = LayoutInflater.from(context).inflate(R.layout.viewpager_layout_sets, null)
        mView!!.findViewById<Button>(R.id.bt_submit).setOnClickListener(this)
        return mView
    }

    public interface OnSetClickListener {
        fun onSetClick (width:String,height:String)
    }
    private var mOnSetClick : OnSetClickListener? = null
    fun setOnSetClickListener (l:OnSetClickListener) {
        mOnSetClick = l
    }
    override fun onClick(v: View?) {
        if (mOnSetClick != null) {
            Log.e("hjh","--------------------------bt_submit----------")
            mOnSetClick!!.onSetClick(mView!!.findViewById<EditText>(R.id.et_width).text.toString(),mView!!.findViewById<EditText>(R.id.et_height).text.toString())
        }
    }

}